using System;
using System.IO;
using System.Windows;
using Qplus.beans;

namespace Qplus.Commands
{
    /**
     * @author Administrator
     *
     */
    public class ModifyRoomCommand : AbsHeaderHttpCommand , HttpInputStreamProcessor{

	    const String COMMAND = "ModifyRoom";
	
	    private String roomName;
	    private int headType;
	    private String headValue;
	    private long roomID;
	
	    private Room room;
	   // private Observer o;
	    /**
	     * @param command
	     * @param uid
	     * @param UKEY
	     */
	    public ModifyRoomCommand(String uid, String UKEY, Room room)
            : base(COMMAND, uid, UKEY)
        {
		    this.room = room;

	    }

	    /**
	     * @param roomName聊天室名称
	     * @param headType聊天室头像类型
	     * @param headValue头像值
	     */
	    public void set(long roomID, String roomName, int headType, String headValue){
		    setRoomID(roomID);
		    setRoomName(roomName);
		    setHeadType(headType);
		    setHeadValue(headValue);
	    }
	
	    private void setRoomName(String name){
		    addParams("RoomName", name);
		    roomName = name;
	    }
	
	    private void setRoomID(long roomID){
		    this.roomID = roomID;
		    addParams("RoomID", roomID);
	    }
	
	    private void setHeadType(int headType){
		    addParams("HeadType", headType);
		    this.headType = headType;
	    }
	
	    private void setHeadValue(String headValue){
		    addParams("HeadValue", headValue);
		    this.headValue = headValue;
	    }
	
	    public HttpTask execute(String url) {
		    return base.execute(url, this);
	    }

	    
	    public override Boolean processInputStream(Stream responseStream) {
		  //TODO
		    return true;
	    }

	    
	    public override void onSuccess(int code) {
	    }


        public override void onFailed(int code)
        {
	    }
	
	    public void onModifyRoom(Room room){
	    }
    }
}